package com.lmf.annotation.tx;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class UserService {

    @Autowired
    private UserDao userDao;

    @Transactional  //事务注解
    public void insert(){
        int insert = userDao.insert();
        System.out.println("插入完成影响的语句："+insert);
        int a=5/0;
    }
}
